package com.gitee.feizns.itrip.personal.utils.service.exception;

/**
 * 业务层异常基类
 * @author feizns
 * @since 2019/1/13 0013
 */
public abstract class ServiceException extends RuntimeException {

    /**
     * 未知的错误
     */
    public static final String UNKNOWN_ERROR = "1";

    /**
     * 数据校验错误
     */
    public static final String VALIDATE_ERROR = "2";

    /**
     * 错误编号
     */
    private String errorCode;

    public ServiceException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public ServiceException(String errorCode, String message, Throwable e) {
        super(message, e);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

}
